#pragma once
#include <Rz/IObject.h>
#include <Rz/Graphics/Math/Vector2.h>
#include <Rz/Graphics/Math/Vector4.h>
#include <Rz/Graphics/Render/IDeviceResource.h>
#include "IBindableResource.h"

RZ_CLASS_FWD_DECL3(Rz, Graphics, Render, IRenderDevice)

namespace Rz { namespace Graphics { namespace Render { 

enum class CullMode
{
	None					= 0x00,
	ClockwiseFace			= 0x01,
	CounterClockwiseFace	= 0x02
};

enum class ClearOption
{
	DepthBuffer				= 0x01,
	ColorBuffer				= 0x02,
	StencilBuffer			= 0x04
};

enum class FillMode
{
	Solid					= 0x01,
	Wired					= 0x02
};

class IRasterizerState :
	virtual public IObject,
	virtual public IDeviceResource,
	virtual public IBindableResource
{
	public:
		RZ_RTTI_INTERFACE(Rz::Graphics::Render, IRasterizerState);
		RZ_RTTI_IMPLEMENTS(IObject, IDeviceResource, IBindableResource);
		RZ_RTTI_END;

		virtual void Bind() override { _isBound = true; }
		virtual void Unbind() override { _isBound = false; }
		virtual bool IsBound() const { return _isBound; }

		virtual CullMode GetCullMode() const { return _cullMode; }
		virtual void SetCullMode(CullMode cullMode) { _cullMode = cullMode; }

		virtual FillMode GetFillMode() const { return _fillMode; }
		virtual void SetFillMode(FillMode fillMode) { _fillMode = fillMode; }

		virtual bool GetScissorTestEnable() const { return _scissorTestEnable; }
		virtual void SetScissorTestEnable(bool scissorTest) { _scissorTestEnable = scissorTest; }

	protected:
		IRasterizerState()
			: _isBound(false)
			, _cullMode(CullMode::ClockwiseFace)
			, _fillMode(FillMode::Solid)
			, _scissorTestEnable(false)
		{

		}

	private:
		bool _isBound;
		CullMode _cullMode;
		FillMode _fillMode;
		bool _scissorTestEnable;
};

} } }
